﻿#include <Windows.h>
#include <tchar.h>
#include <locale.h>
#include "../../../../NetEngine_Windows/NetEngine_SourceCode/XyRyNet_CommHdr.h"
#include "../../../../NetEngine_Windows/NetEngine_SourceCode/XyRyNet_ProtocolHdr.h"
#include "../../../../NetEngine_Windows/NetEngine_SourceCode/NetEngine_Client/XEngine_ClientPool/ClientPool_Define.h"
#include "../../../../NetEngine_Windows/NetEngine_SourceCode/NetEngine_Client/XEngine_ClientPool/ClientPool_Error.h"

#pragma comment(lib,"../../../../NetEngine_Windows/NetEngine_SourceCode/Debug/XEngine_ClientPool.lib")
#pragma comment(lib,"Ws2_32.lib")

void __stdcall XClient_CBRecv(XNETHANDLE xhToken, int nIndex, LPCTSTR lpszClientAddr, LPCSTR lpszMsgBuffer, int nMsgLen, LPVOID lParam)
{

}

int main()
{
	XNETHANDLE xhToken = 0;
	WSADATA st_WSAData;
	WSAStartup(MAKEWORD(2, 2), &st_WSAData);
	if (!XClient_PoolConnect_OPen(&xhToken, "192.168.4.37", 5001, 10, XClient_CBRecv, NULL))
	{
		printf("XClient_PoolConnect_OPen:%X\n", XClient_GetLastError());
		return -1;
	}

	while (1)
	{
		Sleep(1000);
	}
	XClient_PoolConnect_Close(xhToken);
	WSACleanup();
	return 0;
}